package com.geekweb.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.geek.log4jcontrol.core.ConfigHis;
import com.geekweb.util.JacksonUtil;
/**
 * Servlet implementation class GetConfigList
 */
public class GetConfigList extends BaseServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * @see BaseServlet#BaseServlet()
	 */
	public GetConfigList() {
		super();
		// TODO Auto-generated constructor stub
	}

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		this.doPost(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		super.initBaseParam(request);
		List<ConfigHis> configHislist = oLog4jControlRemote.getConfigList(operatePwd);
		String listJson = JacksonUtil.writeEntity2Json(configHislist);
		System.out.println(listJson);
		response.getWriter().write(listJson); 
	}
}
